//
//  YLDefineHeader.h
//  YLProject
//
//  Created by YuanGu on 2018/1/11.
//  Copyright © 2018年 WY. All rights reserved.
//

#ifndef YLDefineHeader_h
#define YLDefineHeader_h


//获取屏幕宽度与高度
#define Screen_Height [[UIScreen mainScreen] bounds].size.height
#define Screen_Width  [[UIScreen mainScreen] bounds].size.width
#define Screen_Size   [UIScreen mainScreen].bounds.size
#define YL_NAV_HEIGHT [[UIApplication sharedApplication] statusBarFrame].size.height + 44
#define YL_STATUS_HEIGHT [[UIApplication sharedApplication] statusBarFrame].size.height

//用户信息  单例
#define APP_USER_INFO [YLUserInfo shareInstance]
//控制聊天测试数据显示
#define IS_TEST NO
#define YL_KEY Screen_Width/375.0f
#define YLFont(x) [UIFont systemFontOfSize:x * YL_KEY]
#define YLRandom(r, g, b, a) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:a]
//随机色
#define YLRandomColor YLRandom(arc4random_uniform(256), arc4random_uniform(256), arc4random_uniform(256), 1)
/// 第一个参数是当下的控制器适配iOS11 一下的，第二个参数表示scrollview或子类
#define AdjustsScrollViewInsetNever(controller,view) if(@available(iOS 11.0, *)) {view.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;} else if([controller isKindOfClass:[UIViewController class]]) {controller.automaticallyAdjustsScrollViewInsets = false;}
//
#define kHEXCOLOR(x) [HEXColor getColor:x]
//判断是否是iphone
#define iPhone (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
//判断是否是iPad
#define iPad (UI_USER_INTERFACE_IDIOM()== UIUserInterfaceIdiomPad)
//判断是否是iPod
#define iPod ([[[UIDevice currentDevice] model] isEqualToString:@"iPod touch"])


//判断是否iPhone4s
#define iPhone4s ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 960), UIScreen.mainScreen.currentMode.size) : NO)
//判断是否iPhone5S
#define iPhone5S ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), UIScreen.mainScreen.currentMode.size) : NO)
//判断是否iPhone6PlusBigMode
#define iPhone6 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(750, 1334), UIScreen.mainScreen.currentMode.size) : NO)
//判断是否iPhone6
#define IPhone6Plus ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1242, 2208), UIScreen.mainScreen.currentMode.size) : NO)
//判断是否iPhone6PlusBigMode
#define iPhone6PlusBigMode ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2001), UIScreen.mainScreen.currentMode.size) : NO)
// 判断是否是iPhone X
#define iPhoneX ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), UIScreen.mainScreen.currentMode.size) : NO)

// 状态栏高度
#define STATUS_BAR_HEIGHT (iPhoneX ? 44.f : 20.f)
// 导航栏高度
#define NAVIGATION_BAR_HEIGHT (iPhoneX ? 88.f : 64.f)
// tabBar高度
#define TAB_BAR_HEIGHT (iPhoneX ? (49.f+34.f) : 49.f)
// home indicator
#define HOME_INDICATOR_HEIGHT (iPhoneX ? 34.f : 0.f)
// normal space width
#define NormalWidth 10.0

/// 底部宏，吃一见长一智吧，别写数字了
#define YLSafeAreaBottomHeight (iPhoneX ? 34 : 0)


// 日志输出
#ifdef DEBUG
#define YLLog(...) NSLog(__VA_ARGS__)
#else
#define YLLog(...)
#endif

#endif /* YLDefineHeader_h */
